Skip to main content

Calibration

Easily add measurement or dimensioning tools to your web, mobile, or desktop app. Use built-in calibration tools to define a drawing's or plan's scale.

API

startCreate

Create a calibration. You can select between Area, Annotations, Measure and Perimeter.

ParamTypeDescription
toolstringSelect the desired tool
[single]boolSelect true to make a single measure, false to make a multi-point measure
[color]stringChange the color of the annotation tool
[showLength]boolToogle visibility of the length drawing of the measure - area and perimeter tool
[single]boolSelect true to make a single measure, false to make a multi-point measure
[guid]stringSet a group_guid if you want to add a pin to an existing group

Available tool options:

  • annotation: Select the annotation tool.
  • measure: Select measure tool.
  • area: Select area tool.
  • perimeter: Select perimeter tool.
  • calibration: Set a calibration to match the scale of the plan on the pdf.

Example

TFTPDFGadget.callCommand({
name: "startCreate",
args: {
tool: "perimeter",
showLength: "false",
},
callback: myfunc,
});

setCalibration ⇒ JSON

Set your paper/plan's scale.

ParamTypeDescription
measureLnumberThe measure reading from overlay
measureXnumberThe desired measure to make a calibration
unitstringThe unit to display

Available unit options:

  • cm: Select centimeters as the unit to display.
  • mm: Select millimeters as the unit to display.
  • m: Select meters as the unit to display.

Example

TFTPDFGadget.callCommand({
name: "setCalibration",
args: { measureL: 2500, measureX: 150, unit: "m" },
callback: myfunc,
});

resetCalibration

Reset the current Calibration.

Example

TFTPDFGadget.callCommand({
name: "resetCalibration",
callback: myfunc,
});